feat!: Add Builder, make timeout std::time::Duration, add configurable poll_frequency, sleep between checks is relative to timeout#165
Conversation
There was a problem hiding this comment.
chore!:
timeoutnow has typestd::time::Duration
This is not a chore but a fix.
| } | ||
|
|
||
| /// See `spawn` | ||
| pub fn spawn_with_options(command: Command, options: Options) -> Result<PtySession, Error> { |
There was a problem hiding this comment.
This commit is a breaking change but isn't marked as such
|
|
||
| /// Process factory, which can be used in order to configure the properties of a command. | ||
| #[derive(Default)] | ||
| pub struct Builder { |
There was a problem hiding this comment.
Normally a builder gets named for what it is building, so PtySessionBuilder
| #[derive(Default)] | ||
| pub struct Builder { | ||
| /// A command to spawn | ||
| pub(super) command: Option<Command>, |
There was a problem hiding this comment.
pub(super) doesn't seem to be needed
| /// Set the command which will be executed | ||
| pub fn command(mut self, command: Command) -> Self { | ||
| self.command = Some(command); | ||
| self |
There was a problem hiding this comment.
This is set in new, why are we allowing it to be overridden?
| } | ||
|
|
||
| /// Set filtering out escape codes, such as colors. | ||
| pub fn strip_ansi_escape_codes(mut self) -> Self { |
| #[derive(Default)] | ||
| pub struct Builder { | ||
| /// A command to spawn | ||
| pub(super) command: Option<Command>, |
There was a problem hiding this comment.
Why allow an Option<Command> instead of a Command?
There was a problem hiding this comment.
Note: this needs a much bigger API re-work than to just add a builder because of the interactions within the different session types.
Closes #142
Closes #144